package com.ddatsh.transaction;

import org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean;

import com.ddatsh.transaction.core.MainEntry;

public class HttpInvokerProxyFactory<O extends Object> {

	@SuppressWarnings("unchecked")
	public O getProxy(String serviceUrl) {

		HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();

		httpInvokerProxyFactoryBean.setServiceInterface(MainEntry.class);

		httpInvokerProxyFactoryBean.setServiceUrl(serviceUrl);

		httpInvokerProxyFactoryBean.afterPropertiesSet();

		return (O) httpInvokerProxyFactoryBean.getObject();

	}
}
